define(['knockout','config'], function (ko,Config) {
    var reg = {
        widget: function () {
            //system manage
            ko.components.register('cmp:SystemManage', {
                viewModel: {require: 'apps/ams/system/system'},
                template: {require: 'text!common/template/TMainCol2.html'}
            });
            //user
            ko.components.register('cmp:UserCard', {
                viewModel: {require: 'apps/ams/system/user/UserCard'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:UserForm', {
                viewModel: {require: 'apps/ams/system/user/UserForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:UserEditForm', {
                viewModel: {require: 'apps/ams/system/user/UserEditForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:UserQueryForm', {
                viewModel: {require: 'apps/ams/system/user/UserQueryForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //department
            ko.components.register('cmp:DepartmentCard', {
                viewModel: {require: 'apps/ams/system/department/DepartmentCard'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:DepartmentForm', {
                viewModel: {require: 'apps/ams/system/department/DepartmentForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:DepartmentQueryForm', {
                viewModel: {require: 'apps/ams/system/department/DepartmentQueryForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //role
            ko.components.register('cmp:RoleCard', {
                viewModel: {require: 'apps/ams/system/role/RoleCard'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:RoleForm', {
                viewModel: {require: 'apps/ams/system/role/RoleForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //menu
            ko.components.register('cmp:MenuCard', {
                viewModel: {require: 'apps/ams/system/menu/MenuCard'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:MenuForm', {
                viewModel: {require: 'apps/ams/system/menu/MenuForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //dict
            ko.components.register('cmp:DictCard', {
                viewModel: {require: 'apps/ams/system/dict/DictCard'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:DictForm', {
                viewModel: {require: 'apps/ams/system/dict/DictForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:DictQueryForm', {
                viewModel: {require: 'apps/ams/system/dict/DictQueryForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //classify
            ko.components.register('cmp:ClassifyCard', {
                viewModel: {require: 'apps/ams/system/classify/ClassifyCard'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:ClassifyForm', {
                viewModel: {require: 'apps/ams/system/classify/ClassifyForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:ClassifyQueryForm', {
                viewModel: {require: 'apps/ams/system/classify/ClassifyQueryForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //archive manage
            ko.components.register('cmp:ArchiveManage', {
                viewModel: {require: 'apps/ams/archive/archive'},
                template: {require: 'text!common/template/TMainCol.html'}
            });
            ko.components.register('cmp:ArchiveDepartment', {
                viewModel: {require: 'apps/ams/archive/ArchiveDepartment'},
                template: {require: 'text!common/template/TMainCol2.html'}
            });
            ko.components.register('cmp:ArchiveList', {
                viewModel: {require: 'apps/ams/archive/ArchiveList'},
                template: {require: 'text!common/template/TCard.html'}
            });
            ko.components.register('cmp:ArchiveForm', {
                viewModel: {require: 'apps/ams/archive/ArchiveForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:ArchiveQueryForm', {
                viewModel: {require: 'apps/ams/archive/ArchiveQueryForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:FileForm', {
                viewModel: {require: 'apps/ams/archive/FileForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:AttachmentList', {
                viewModel: {require: 'apps/ams/archive/AttachmentList'},
                template: {require: 'text!common/template/TMainCol.html'}
            });
            ko.components.register('cmp:AttachmentAddForm', {
                viewModel: {require: 'apps/ams/archive/AttachmentAddForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:AttachmentEditForm', {
                viewModel: {require: 'apps/ams/archive/AttachmentEditForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:AttachmentQueryForm', {
                viewModel: {require: 'apps/ams/archive/AttachmentQueryForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            //search
            ko.components.register('cmp:Search', {
                viewModel: {require: 'apps/ams/search/search'},
                template: {require: 'text!common/template/TMainCol.html'}
            });
            ko.components.register('cmp:SearchForm', {
                viewModel: {require: 'apps/ams/search/SearchForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:Components',{
               viewModel: {require: 'common/vm/empty'},
               template: {require: 'text!common/template/TComponents.html'}
            });
            //print
            ko.components.register('cmp:PrintConfigForm', {
                viewModel: {require: 'apps/ams/print/PrintConfigForm'},
                template: {require: 'text!common/data/form/AForm.html'}
            });
            ko.components.register('cmp:PrintArchiveCatalog', {
                viewModel: {require: 'apps/ams/print/PrintArchiveCatalog'},
                template: {require: 'text!apps/ams/print/PrintArchiveCatalog.html'}
            });
            ko.components.register('cmp:PrintInnerFileCatalog', {
                viewModel: {require: 'apps/ams/print/PrintInnerFileCatalog'},
                template: {require: 'text!apps/ams/print/PrintInnerFileCatalog.html'}
            });
            ko.components.register('cmp:PrintArchiveCover', {
                viewModel: {require: 'apps/ams/print/PrintArchiveCover'},
                template: {require: 'text!apps/ams/print/PrintArchiveCover.html'}
            });
        }
    };

    return {
        registerCmp: function () {
            reg.widget();
        }
    }
});
